package com.yupi.springbootinit.spark;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@RestController
@RequestMapping("/spark")
@Slf4j
public class SparkController {
    @Resource
    SparkManager sparkManager;
    @PostMapping("/test")
    public String chat(@RequestParam("question") String question) {
        try {
            return sparkManager.doChat(132, question);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
